#  Copyright (c) 2023. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
#  Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
#  Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
#  Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
#  Vestibulum commodo. Ut rhoncus gravida arcu.

# coding:utf8


# 家 公司 电脑的名称
import os


class Pcname:
    home = "LAPTOP-AM8AN2A3"
    lenvo  = 'PC-201912241039'
    company = "SK-20220810LFPV"
    
# 调试模式
debug = False
# 默认PBX的IP尾部字段
DEFAULT_PBX_TAIL = 240
# SIP项目的各种路径
class Path:
    newsip = r"D:\_python\my\xdkj_test\config\sip_data\default_user_config - 带备注（增加了J4G通话配置）(1).txt"
    oldsip = r"D:\_python\my\xdkj_test\config\sip_data\带手柄config.cfg"
    config_path = "config\\sipmachine.json"
    
    driverDict = {
        Pcname.home: r"d:\python\chromedriver_win32\chromedriver.exe",
        Pcname.company: r"e:\python\chromedriver_win32\chromedriver.exe",
        Pcname.lenvo: r"c:\Users\Administrator\AppData\Local\Google\Chrome\Application\chromedriver.exe",
    }
    configSipTestDict = {
        Pcname.company : r"F:\___0000\调试\333333333333333333333333333333.txt",
        Pcname.lenvo : "",
    }

    @classmethod
    def get_path(cls, dict_:dict):
        return dict_.get(get_pc_name())
        
    @classmethod
    def get_driver(cls, keydict):
        """
        获得驱动的路径
        """
        return  cls.driverDict.get(keydict, "")
    


def get_pc_name():
    return os.popen("hostname").read().strip()


class GetEnvironmentParameter(object):

    def __init__(self):
        cur_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
        self.parameter_path = os.path.join(os.path.join(cur_path, 'config'), 'environment_parameter.yaml')
        if not os.path.exists(self.parameter_path):os.mkdir(self.parameter_path)